<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <!-- 
    谁注册了组件，组件只能被注册该组件的组件使用
   -->

  <div id="app">
    <c></c>
    <parent></parent>
  </div>
  <script src="./vue.js"></script>
  <script>
    // 创建组件配置对象
    const child = {
      template: `
        <div>组件</div>
      `
    }
    
    Vue.component('parent', {
      template: `
        <div>
          内容
          <c></c>
        </div>
      `,
      components: {
        c: child
      }
    })

    const app = new Vue({
      el: '#app',
      data: {

      },
      components: {
        c: child
      }
    })
  
  </script>
</body>
</html>